/**
 * 渠道运营－中介机构
 */
define(function (require, exports, module) {
    require('authorize');
    var util = require('util');
    var ui = require('ui');
    var angular = require("angular");
    require("angular-ui");
    require("angular-route");
    require("angular-interceptor");
    require("datepicker");
    require("./review");
    require("./unreview");
    require("permission");
    require('global');

    var api_prefix = G_CONFIG.api_prefix + "qmyx/agency/";

    var app = angular.module('app', ['ngRoute', 'ngUI', 'Review','ngInterceptor','Unreview'])
        .config(['$routeProvider', function ($routeProvider) {
            $routeProvider
                .when('/unreview', {templateUrl: 'inc/unreview.html'})
                .when('/review', {templateUrl: 'inc/review.html'})
                .otherwise({redirectTo: '/unreview'});
        }])
        .controller('MainController', ['$rootScope', '$scope', '$location', '$http',
            function ($rootScope, $scope, $location, $http) {
                $scope.tabs = [
                    {value: '/unreview', name: '未审核'},
                    {value: '/review', name: '已审核'}
                ];
                $scope.current = $location.path();
                $rootScope.$on('$routeChangeSuccess', function () {
                    $scope.current = $location.path();
                });
            }
        ]);

    angular.bootstrap(document, ['app']);
});